<template>
 <el-form :model="tableDate" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  <el-collapse v-model="activeNames" @change="handleChange">
    <el-collapse-item :title="items.carName"  v-for='(items,index) in tableData.carTypes' :key='index'>
        <el-card>
          <div class="text item">
            <el-form-item label="指导价(元)" prop="name">
              <el-input :value="items.guidePrice| toFixed2" disabled></el-input>
               <span class="convertCurrency">{{items.guidePrice|convertCurrency}}</span>
            </el-form-item>
            <el-form-item label="配置" prop="name">
              <el-input v-model="items.carConfig" type='textarea' disabled></el-input>
            </el-form-item>
            <el-form-item label="采购单价(元)" prop="name">
              <el-input :value="items.carPurchasePrice| toFixed2" disabled></el-input>
               <span class="convertCurrency">{{items.carPurchasePrice|convertCurrency}}</span>
            </el-form-item>
            <el-form-item label="汽车数量" prop="name">
              <el-input v-model="items.carCount" disabled></el-input>
            </el-form-item>
            <el-form-item label="采购金额(元)" prop="name">
              <el-input :value="items.carPurchaseMoney| toFixed2" disabled></el-input>
               <span class="convertCurrency">{{items.carPurchaseMoney|convertCurrency}}</span>
            </el-form-item>
            <el-form-item label="融资金额(元)" prop="name">
              <el-input :value="items.carMortgageMoney| toFixed2" disabled></el-input>
               <span class="convertCurrency">{{items.carMortgageMoney|convertCurrency}}</span>
            </el-form-item>
            <el-form-item label="采购合同">
              <qiniu :qiniuImage="items.carContractPics" :id="items.carContractPics.id" :canDelete="false"></qiniu>
            </el-form-item>

          </div>
        </el-card>
        <el-container v-if='items.mortgageInspectionList.length!=0'>
        <el-card v-for="(childItem,key) in items.mortgageInspectionList" :key='key'>
          <span>数量{{key+1}}</span>
          <div class="text item">
            <el-form-item label="汽车颜色" prop="name">
              <el-input v-model="childItem.color" disabled></el-input>
            </el-form-item>
            <el-form-item label="车架号" prop="name">
              <el-input v-model="childItem.vin" disabled></el-input>
            </el-form-item>
            <el-form-item label="生产日期" prop="name">
              <el-input v-model="childItem.productionDate" disabled></el-input>
            </el-form-item>
            <el-form-item label="发动机号" prop="name">
              <el-input v-model="childItem.engineNumber" disabled></el-input>
            </el-form-item>
            <el-form-item label="验车照片">
              <qiniu :qiniuImage="childItem.inspectionPics" :id="childItem.inspectionPics.id" :canDelete="false"></qiniu>
            </el-form-item>

            <el-form-item label="手续照片">
              <qiniu :qiniuImage="childItem.proceduresPics" :id="childItem.proceduresPics.id" :canDelete="false"></qiniu>
            </el-form-item>

          </div>
        </el-card>
        </el-container>
    </el-collapse-item>
  </el-collapse>
</el-form>



</template>

<script>
  import qiniu from '@/views/qiniu/upload';
     
  export default {
    data() {
      return {
        activeNames: [],
        tableDate: [],
        qiniuImage: {
          id: "qiniuImage", //图片预览的id   
          image_uri: [
            'http://h.hiphotos.baidu.com/image/h%3D300/sign=6ee370b8861363270aedc433a18fa056/11385343fbf2b211ec2f692ac68065380cd78e55.jpg'
          ], //图片上传的列表  只含有url地址
        },
      };
    },
    methods: {
      handleChange(val) {
        // console.log(val);
      }
    },
    components: {
      qiniu
    },
    props:{
      tableData:{
        type:Object
      }
    },
    mounted(){
            console.dir(this.tableData)  
    }
  }

</script>

